package com.xigua.chapter_7_Builder.framework;

/**
 * @author LiRongHua
 * @Title: ${file_name}
 * @Package ${package_name}
 * @Description: ${todo}
 * @date 2022/4/1416:37
 */
public class TextBuilder extends Builder{

    private StringBuffer str = new StringBuffer();

    public void makeTitle(String title) {
        str.append("===================================\n");
        str.append("["+title+"]\n");
        System.out.println("\n");
    }



    public void makeString(String str) {
        this.str.append("."+str+"\n");
    }

    public void makeItems(String[] items) {
        for (int i = 0; i < items.length; i++) {
            str.append(" ."+items[i]+"\n");
        }
        str.append("\n");
    }

    public void close() {
        str.append("============================\n");
    }

    public String getReult(){
        return str.toString();
    }
}
